import json

def parse_wk(pth):
    with open(pth,'r') as f:                               
        c=f.read()                                     
    c = c[8:-1]                                                                      
    o = json.loads(c)                                                 
    arr_txt = [i['c'] for i in o['body'] if type(i['c'])==type('') ]    
    txt = ''.join(arr_txt)
    return txt

lst_wenku = ['wenku_{}-0.js'.format(i) for i in range(1,9)]

import os
work_dir = os.path.dirname( __file__ )
if __name__ == '__main__':
    arr_wk = [ parse_wk(os.path.join(work_dir, pth_wk)) for pth_wk in lst_wenku]
    txt_wk = '\n'.join(arr_wk)
    print(txt_wk)
    with open('wenku.txt', 'w+', encoding='utf-8') as f:
        f.write(txt_wk)
    # f = open('wenku.txt', 'w+', encoding='utf-8')
    # f.write(txt_wk)
    # f.close()